<?php
/**
 * Veneer CMS

Depending on site.ini
Msite can force logging too
This will log to either/both disk and DB

Debug Modes - can be set by session
write to DB
write to disk - based on hour
write to session

Enhancements
session - track a series of log messages

 */

class Veneer_Log
{

    protected $_dbArray =array();
    protected $_moduleName = null;
    protected $_module_id = 0;
    protected $_config_module;
    protected $_primary_table;

	protected $_dbAdapter;	// login
	protected $_registry;	// login
	protected $_debug;	// login

	protected $_logWriter;
	protected $_logger;

	function __construct( $logDb = false, $logDisk=false, $debugMode=false)
	{
		$this->_registry = Zend_Registry::getInstance();

		$this->_dbAdapter = $this->_registry->get('dbAdapter');
		$columnMapping = array('lvl' => 'priority', 'dt_created'=>'timestamp','msg' => 'message');
		$this->_logWriter = new Zend_Log_Writer_Db($this->_dbAdapter, 'log', $columnMapping);

		$this->_logger = new Zend_Log($this->_logWriter);
	}

    public function info($message, $priority='INFO')
    {
		$this->_logger->info($message);
	}

    public function debug($message)
    {
		$this->_logger->debug($message);
	}
}